package hzst.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * 避免在ScrollView Listview 中出现无法撑开只显示一行情况出现的Listview
 * Created by Administrator on 2016/11/3.
 */
public class MyListview extends ListView {

    public MyListview(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyListview(Context context) {
        super(context);
    }

    public MyListview(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }

}
